package com.lc.demo.mapper;

import com.lc.demo.bean.Admin;
import com.lc.demo.bean.Jwc;
import com.lc.demo.bean.Teacher;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: sakila
 * @Date: 2022/04/03/12:47
 * @Description:
 */

@Mapper
public interface JwcMapper {

    @Select("select * from t_jwc where  username=#{username} and password=#{password}")
    Jwc login(@Param("username") String username, @Param("password") String password);


    @Insert("insert into admin(username,name,password,departmentid,departmentname)  values(#{username},#{name},#{password},#{departmentid},#{departmentname})")
    void addAdmin(Admin admin);

    @Delete("delete from admin where id=#{id}")
    void deleteAdmin(Admin admin);

    @Update("update admin set name=#{name},password=#{password},departmentid=#{departmentid},departmentname=#{departmentname} where id=#{id}")
    void updateAdmin(Admin admin);
    @Select("select * from admin")
    List<Admin> getAdminList(Admin admin);
    @Select("select * from teacher")
    List<Teacher> getTeacherList(Teacher teacher);
}
